package ch.simplix.android.net.discoverer.bluetooth;

import java.util.Vector;


/**
 * Describes a measurement containing several readings from the bluetooth-Discoverer
	@author SimpliX
 */
public class BluetoothMeasurement {

	
	

	/* time of measurment */
	protected long timestamp = 0;
	
	/* set of Bluetooth readings that where taken during the measurement */
	protected Vector<BluetoothReading> bluetoothReadings;

	/* constructor */
	public BluetoothMeasurement() {
		this(new Vector<BluetoothReading>());
		
	}
	
	public BluetoothMeasurement(Vector<BluetoothReading> bluetoothReadings) {
		timestamp = System.currentTimeMillis();		
		this.bluetoothReadings = bluetoothReadings;
	}


	/* ************ Getter and Setter Methods ************ */

	/**
	 * @return the timestamp
	 */
	public long getTimestamp() {
		return timestamp;
	}

	/**
	 * @param timestamp
	 *            the timestamp to set
	 */
	public void setTimestamp(long timestamp) {
		this.timestamp = timestamp;
	}

	
	/**
	 * @return the bluetooth readings
	 */
	public Vector<BluetoothReading> getBluetoothReadings() {
		return bluetoothReadings;
	}
	public void setBluetoothReadings(Vector<BluetoothReading> bluetoothReadings) {
		this.bluetoothReadings = bluetoothReadings;
	}

	public void addBluetoothReading(BluetoothReading bluetoothReading) {
		this.bluetoothReadings.addElement(bluetoothReading);
	}
	@Override
	public String toString() {
		String toString="";		
		if(bluetoothReadings!=null)
			for(BluetoothReading bluetoothReading:this.bluetoothReadings)
			{
				toString+=bluetoothReading+"\n";
			}
		
		return toString;
	}
}
